\documentclass[test.tex]{subfiles}

\begin{document}
\section{Section 3 (sub)}
\label{sec:section3_sub}
Text in section 3

\section{Section 4 (sub)}
\label{sec:section4_sub}
Text in section 4

\end{document}
